<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/vue.global.js"></script>
</head>
<body>

<div id="app">
    <ul>
        <li style="background-color: orange">第一个</li>
        <li style="background-color: orange;color: cornflowerblue">第二个</li>
        <li :style="{'background-color':'orange'}">第三个</li>
        <li :style="{backgroundColor:'orange'}">第四个</li>
        <li :style="{'background-color':'orange',color: 'cornflowerblue'}">第五个</li>
        <li :style="sty1" @click="change_color">第六个</li>
        <li :style="[sty1,sty2]">第七个</li>
    </ul>
</div>
<script>
    var vm = Vue.createApp({
        data() {
            return {
                sty1: {
                    backgroundColor: 'orange',
                    color: 'cornflowerblue',
                },
                sty2: {
                    fontSize: '32px'
                }
            }
        },
        methods:{
            change_color(){
                if (this.sty1.color === 'cornflowerblue'){
                    this.sty1.color = 'blue'
                }else {
                    this.sty1.color = 'cornflowerblue'
                }
            }
        }
    }).mount("#app")
</script>
</body>
</html>